from typing import TYPE_CHECKING

from sqlalchemy import Boolean, Column, Integer, String, text, TIMESTAMP
from sqlalchemy.orm import relationship

from app.db.base_class import Base


class Constant(Base):
    __tablename__ = 'tb_constant'

    id = Column(Integer, primary_key=True)
    code = Column(String(16))
    itemCode = Column('item_code', String(32))
    itemName = Column('item_name', String(16))
    itemValue = Column('item_value', String(8))
    orderNum = Column('order_num', Integer)
    state = Column(String(1))
    createdDate = Column('created_date', TIMESTAMP, server_default=text('CURRENT_TIMESTAMP'))
    updatedDate = Column('updated_date', TIMESTAMP,
                         server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'))
